{% extends "admin/change_form.html" %}

{% block extrahead %}
<script src="{{ STATIC_URL }}jquery.js" type="text/javascript"></script>
<script type="text/javascript" >
$(document).ready(function(){
   $('#id_enrollment').change(function(){
      $.getJSON("/student/assignments-eid/" + $('#id_enrollment').val() + "/", { }, function(json){
         $('#id_assignment').children().remove().end().append('<option value="">---------</option>');
         $.each(json, function(i, assignment) {
            $('#id_assignment').append($("<option></option>").attr("value",assignment.pk).text(assignment.name));
         });
      });
   });
});
</script>

{% endblock %}

